// 所有关于地址的接口
import request from '../utils/request'

// 获取省的接口
export function _getProvince(){
  return request("/common/region/v2/province","get",{},"common")
}
// 获取市和县的接口
export function _getCityOrArea(pid){
  return request("/common/region/v2/child","get",{pid:pid},"common")
}
// 添加收货地址接口
export function _plusAddress(data){
  return request("/user/shipping-address/add","post",data)
}
// 获取收货地址列表接口
export function _getAddressList(){
  return request("/user/shipping-address/list","get",{
    token:wx.getStorageSync('token')
  })
}
// 删除地址接口
export function _delAddress(id){
  return request("/user/shipping-address/delete","post",{
    id:id,
    token:wx.getStorageSync('token')
  })
}
// 获取收货地址详情接口
export function _getAddressInfo(id){
  return request("/user/shipping-address/detail/v2","get",{
    id:id,
    token:wx.getStorageSync("token")
  })
}
// 地址编辑接口
export function _editAddress(data){
  return request("/user/shipping-address/update","post",data)
}
// 获取默认收货地址接口
export  function _getDeafault(){
  return  request("/user/shipping-address/default/v2","get",{
    token:wx.getStorageSync("token")
  })
}